<?php
namespace Home\Controller;
use Think\Controller;
class jiedanController extends Controller {
    public function index(){
        echo 'Hello Admin';
    }
 public function gallery(){
        //调用模型层获取数据
        $goodsmodel = M('goods');
        //var_dump($usersmodel);
        $goods=$goodsmodel->order('id desc')->select();
        //调用视图层显示数据
        $this->goods=$goods;
        //var_dump($users);
        $this->display();
    }
    public function delgoods($id){
        //调用模型层获取数据
        $goodsmodel = M('goods');
        $goodinfo=$goodsmodel->where("id=$id")->find();
      
        if (false !== $goodsmodel->where("id=$id")->delete()) {
            $this->success('订单完成！');//success显示笑脸
        } else {
            $this->error('完成失败 ');//显示一个哭脸
        }
        
    }

}